//
//  KirinrinUitl.h
//  SunshineKinderGarten
//
//  Created by Kirinrin on 1/20/14.
//  Copyright (c) 2014 Kirinrin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AppDelegate.h"
#import <AssetsLibrary/AssetsLibrary.h>

#import "NetworkAccessManager.h"



@interface UtilHelper : NSObject

//md5 32位 加密 （小写）
+ (NSString *)md5LowCase:(NSString *)str;
+(void)showDial:(UIWindow *)window
  indicatorView:(UIActivityIndicatorView *) activityIndicatorView;
+(void) hideDial:(UIWindow *)window indicatorView:(UIActivityIndicatorView *)activityIndicatorView;
+(NSString *)removeHtmlMarker:(NSString*)html;
+ (NSString *)intervalSinceNowString: (NSString *) theDate;
+ (NSString *)intervalSinceNow: (NSDate *) theDate;
+ (NSString *)intervalSinceNowStringWithT: (NSString *) theDate;

+ (NSDate *)formatDateStringWithT:(NSString *)theDate;
+ (NSDate *)formatDateString:(NSString *)theDate :(NSString *)formatString;
+ (BOOL)isSameDay:(NSDate*)date1 date2:(NSDate*)date2;
/*
 * 裁剪图的大小
 
 */
+ (UIImage *)imageWithImage: (UIImage *) sourceImage scaledToSize: (CGSize)targetSize;

/*
 * 获取原图
 */
+ (UIImage *)fullResolutionImageFromALAsset:(ALAsset *)asset;
+ (UIImage *)thumbnailImageFromALAsset:(ALAsset *)asset;
+(AppDelegate *) appDelegate;

+(UIColor *)getRandomColor;
+(NSString *)removePreCharacter:(NSString *)filepath;


/* check if is validate */
+(BOOL)checkPhoneNumInput:(NSString *)text;
+(BOOL)isValidateEmail:(NSString *)email;
+(BOOL) isValidateMobile:(NSString *)mobile;
+(BOOL)checkStringLengthBetween:(NSUInteger)start and:(NSUInteger)end;
+(BOOL)checkPasswordValidate:(NSString *)password repeatPassword:(NSString *)repertPassword maxlength:(NSUInteger)length;

+(char) pinyinFirstLetter:(unsigned short )hanzi;
@end
